﻿@page "/doc"
@page "/doc/{page}"
@inherits BaseComponent

<PageTitle>@model?.Title - @AppConfig.AppTitle</PageTitle>

<UMenuBar Target="cl-doc-menu" />
<div class="container cl-container cl-doc">
    <UDocMenu Type="ContentType.Document" />
    <CmsCard>
        <div class="count"><i class="far fa-eye" /> @model?.ViewQty</div>
        <div class="cl-doc-body">
            @CmsUtils.GetMarkdownHtml(model)
        </div>
    </CmsCard>
</div>

@code {
    private ISiteService Service;
    private PostDetailInfo model;

    [Parameter] public string Page { get; set; }

    protected override async Task OnInitAsync()
    {
        await base.OnInitAsync();
        Service = await CreateServiceAsync<ISiteService>();
        model = await Service.GetPostAsync(ContentType.Document, Page);
    }
}